

#ifndef JSON_RW_ID_H
#define JSON_RW_ID_H

#include <iostream>
#include "rapidjson/document.h"
#include "rapidjson/stringbuffer.h"
#include "rapidjson/prettywriter.h"
#include "rapidjson/filereadstream.h"
#include "rapidjson/filewritestream.h"
#include "rapidjson/writer.h"
#include <fstream>
#include <ctime>
#include <stdio.h>

#define file_topdir "/tmp/app/bin"


namespace tbox_msg
{
    class jsonTboxId
    {
    private:
        rapidjson::Document document;
        std::string json_content_path;

    public:

        std::string user_name;
        std::string password;
        std::string client_id;
        std::string product_key;
        std::string device_name;
        std::string public_topic;
        std::string subscribe_topic;

    public:
        jsonTboxId(){};
        ~jsonTboxId(){};
        std::string get_filecontent(const char *filePath,const char *fileName);
        bool tbox_read_id(const std::string json_content);
        bool tbox_write_id(const char *filePath, const char *filename);
    };

} // namespace name

#endif
